|
AT-NFC
2.1 (win)
AT-NFC kernel set
|
Kernel export functions. More...
Data Structures | |
| struct | tag_KER_OFFLINE_PIN_DATA |
| offline PIN cvm related data structure More... | |
Typedefs | |
| typedef struct tag_KER_OFFLINE_PIN_DATA | KER_OFFLINE_PIN_DATA |
| offline PIN cvm related data structure More... | |
Functions | |
| KER_RES KER_API | kerInit (KER_CTX_INIT_PARAM const KER_VOID *pConfigID, KER_INT16U usConfigIDLen, const KER_CHAR *pchKernelFiles, KER_INT16U usKernelFilesLen) |
| Performs kernel initialization. More... | |
| KER_RES KER_API | kerDeInit (KER_CTX_SINGLE_PARAM) |
| Performs kernel de-initialization. More... | |
| KER_BOOL KER_API | kerVerInfo (KER_CTX_PARAM KER_CHAR **ppchEmvVer, KER_INT16U *pusEmvVerLen, KER_CHAR **ppchLibVer, KER_INT16U *pusLibVerLen) |
| Obtains emv kernel library version info. More... | |
| KER_BOOL KER_API | kerCheckATR (KER_CTX_PARAM const KER_BYTE *pbtATR, KER_BYTE btATRLen, KER_BYTE *pbtChipProto) |
| Check ATR for chip protocol to use. More... | |
| KER_RES KER_API | kerBuildCL (KER_CTX_PARAM KER_BYTE btChipProtocol, KER_BOOL bUsePSE, KER_TLV **ppCandidateList, KER_TLV **ppBlockedAppList) |
| Creates CL by all available methods (PSE & APP list) More... | |
| KER_RES KER_API | kerSelectApp (KER_CTX_PARAM KER_BYTE btChipProtocol, const KER_TLV *pCandidateToSelect, KER_TRAN **ppTran) |
| Makes final app selection. More... | |
| KER_RES KER_API | kerSetTranData (KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtTranData, KER_INT16U usTranDataLen) |
| Pass transaction data to the kernel. More... | |
| KER_RES KER_API | kerInitAppProc (KER_CTX_PARAM KER_TRAN *pTran) |
| Initiate Application Processing. More... | |
| KER_RES KER_API | kerForceOnline (KER_CTX_PARAM KER_TRAN *pTran) |
| Force transaction online by attendant. More... | |
| KER_RES KER_API | kerUpdateTVR (KER_CTX_PARAM KER_TRAN *pTran, const KER_BYTE *pbtData, KER_INT16U usDataLen) |
| Updates TVR from external (some custom cvm may require this) More... | |
| KER_RES KER_API | kerReadAppData (KER_CTX_PARAM KER_TRAN *pTran) |
| Reads application data from ICC. More... | |
| KER_RES KER_API | kerCardInExceptFile (KER_CTX_PARAM KER_TRAN *pTran) |
| Let kernel know, that card appears in terminal exception file. More... | |
| KER_RES KER_API | kerCheckExceptFile (KER_CTX_PARAM KER_TRAN *pTran) |
| Check if card appears in terminal exception file by HAL API. More... | |
| KER_RES KER_API | kerIsCashbackAllowed (KER_CTX_PARAM KER_TRAN *pTran) |
| Check if card supports Cashback. More... | |
| KER_RES KER_API | kerOfflineAuth (KER_CTX_PARAM KER_TRAN *pTran) |
| Performs offline authentification. More... | |
| KER_RES KER_API | kerProcRestrict (KER_CTX_PARAM KER_TRAN *pTran) |
| Performs processing restrictions. More... | |
| KER_RES KER_API | kerCV (KER_CTX_PARAM KER_TRAN *pTran, KER_BYTE *pbtSelectedCVM, KER_BYTE *pbtCustomCVMCode) |
| Performs cardholder verification. More... | |
| KER_RES KER_API | kerSetOnlinePinResult (KER_CTX_PARAM KER_TRAN *pTran, KER_BYTE btResult) |
| Pass online pin entry result to kernel. More... | |
| KER_RES KER_API | kerGetOfflinePinData (KER_CTX_PARAM KER_TRAN *pTran, KER_OFFLINE_PIN_DATA *pOfflinePinData) |
| Get special data for offline pin entry. More... | |
| KER_RES KER_API | kerSetOfflinePinResult (KER_CTX_PARAM KER_TRAN *pTran, KER_BYTE btResult, const KER_BYTE *pbtPinVerifyData, KER_INT16U usPinVerifyDataLen) |
| Pass offline pin entry result to kernel. More... | |
| KER_RES KER_API | kerSetCustomCVMResult (KER_CTX_PARAM KER_TRAN *pTran, KER_BYTE btResult, const KER_BYTE *pbtTvrBitsToSet, KER_BYTE btTvrBitsToSetLen) |
| Pass custom CVM result to kernel. More... | |
| KER_RES KER_API | kerRiskManagement (KER_CTX_PARAM KER_TRAN *pTran) |
| Performs Terminal Risk Management. More... | |
| KER_RES KER_API | kerTAA (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usMode) |
| Performs Terminal Action Analysis. More... | |
| KER_RES KER_API | kerCAA (KER_CTX_PARAM KER_TRAN *pTran) |
| Performs Card Action Analysis. More... | |
| KER_RES KER_API | kerOnline (KER_CTX_PARAM KER_TRAN *pTran, KER_BOOL bUnableToGoOnline, KER_INT16U usReferralResult) |
| Process prev set by kerSetTranData() online authorization data by the kernel and makes second GAC. More... | |
Kernel export functions.
This functions should be called by terminal application
| typedef struct tag_KER_OFFLINE_PIN_DATA KER_OFFLINE_PIN_DATA |
offline PIN cvm related data structure
Termial application should use it:
| KER_RES KER_API kerBuildCL | ( | KER_CTX_PARAM KER_BYTE | btChipProtocol, |
| KER_BOOL | bUsePSE, | ||
| KER_TLV ** | ppCandidateList, | ||
| KER_TLV ** | ppBlockedAppList | ||
| ) |
Creates CL by all available methods (PSE & APP list)
Builds candidate list by PSE and by step by step aid from supported aids list selection (if required). Also generates a list of blocked applications, to allow scheme-specific processing to be applied.
See EMV Book 1: 12.3.2 & 12.3.3 for details.
| [in] | btChipProtocol | - Chip protocol type KER_EMVL1_PROTOCOL_T0 or KER_EMVL1_PROTOCOL_T1 |
| [in] | bUsePSE | - Define preffered build cl method (KER_TRUE - start from select PSE; KER_FALSE - skip PSE and continue with application list) |
| [out] | ppCandidateList | - pointer to obtain allocated candidate list (as a list of 9F06 and related tags) One candidate per container. |
| [out] | ppBlockedAppList | - pointer to obtain blocked app list (as a list of 9F06) (set KER_NUUL if you don't need it) |
Candidate container cotains tag 84 as candidate AID (ASI requested for each candidate internally from config)
| KER_RES KER_API kerCAA | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Performs Card Action Analysis.
See EMV Book 3, 10.8 for details.
Check for advice reqest and reason by kerTranGetFlags
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerCardInExceptFile | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Let kernel know, that card appears in terminal exception file.
See EMV Book 4, 6.3.5 for details.
This function could be called after kerReadAppData and before kerTAA (final before GAC1)
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_BOOL KER_API kerCheckATR | ( | KER_CTX_PARAM const KER_BYTE * | pbtATR, |
| KER_BYTE | btATRLen, | ||
| KER_BYTE * | pbtChipProto | ||
| ) |
Check ATR for chip protocol to use.
| [in] | pbtATR | Buffer with ATR, obtained by hal_emvl1_reset_card |
| [in] | btATRLen | length of pbtATR |
| [out] | pbtChipProto | param to store chip protocol to use (KER_EMVL1_PROTOCOL_T0 or KER_EMVL1_PROTOCOL_T1) |
| KER_RES KER_API kerCheckExceptFile | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Check if card appears in terminal exception file by HAL API.
See EMV Book 4, 6.3.5 for details.
This function could be called after kerReadAppData and before kerTAA (final before GAC1)
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerCV | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_BYTE * | pbtSelectedCVM, | ||
| KER_BYTE * | pbtCustomCVMCode | ||
| ) |
Performs cardholder verification.
See EMV Book 3, 10.5 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [out] | pbtSelectedCVM | - buffer (1 byte) to obtain selected CVM. Can be set to: KER_CVM_SKIP - cardholder verification not supported by card - proceed to next transaction stage KER_CVM_FAIL - cardholder verification failed - proceed to next transaction stage KER_CVM_NO_CVM - cardholder verification not required - proceed to next transaction stage KER_CVM_ONLINE_PIN - online pin requested - call kerSetOnlinePinResult to pass pin entry result KER_CVM_PLAIN_PIN - plaintext offline pin requested - call kerGetOfflinePinData and kerGetOfflinePinData to pass pin entry result KER_CVM_ENC_PIN - enciphered offline pin requested - call kerGetOfflinePinData and kerGetOfflinePinData to pass pin entry result KER_CVM_PLAIN_PIN_SIG - plaintext offline pin & signature requested - call kerGetOfflinePinData and kerGetOfflinePinData to pass pin entry result KER_CVM_ENC_PIN_SIG - enciphered offline pin & signature requested - call kerGetOfflinePinData and kerGetOfflinePinData to pass pin entry result KER_CVM_SIGNATURE - signature requested - proceed to next transaction stage KER_CVM_CUSTOM - custom cvm requested - call kerSetCustomCVMResult to pass custom cvm result |
| [out] | pbtCustomCVMCode | - buffer (1 byte) to obtain selected CVM code as described in EMV Book 3 Annex C CV Rule Byte 1 including "Apply succeeding CV Rule if this CVM is unsuccessful" bit. Should be used for custom cvm processing. (optional, set KER_NULL if you don't need it) |
| KER_RES KER_API kerDeInit | ( | KER_CTX_SINGLE_PARAM | ) |
| KER_RES KER_API kerForceOnline | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Force transaction online by attendant.
This function could be called after kerInitAppProc and before kerTAA (final before GAC1)
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerGetOfflinePinData | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_OFFLINE_PIN_DATA * | pOfflinePinData | ||
| ) |
Get special data for offline pin entry.
See EMV Book 3, 10.5 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [out] | pOfflinePinData | Pointer to the buffer to obtain PIN verify data: plaintext PIN on enciphered pin (with usSize field set) |
| KER_RES KER_API kerInit | ( | KER_CTX_INIT_PARAM const KER_VOID * | pConfigID, |
| KER_INT16U | usConfigIDLen, | ||
| const KER_CHAR * | pchKernelFiles, | ||
| KER_INT16U | usKernelFilesLen | ||
| ) |
Performs kernel initialization.
| [in] | pConfigID | Buffer with configuration ID obtained from Terminal Application (in HAL recognized format) |
| [in] | usConfigIDLen | pConfigID buffer length |
| [in] | pchKernelFiles | buffer with kernel binary file names (for checksum calculation) - set of nul terminated strings ended by nul. |
| [in] | usKernelFilesLen | length of pchKernelFiles including nul-terminating sym |
Terminal Application should init kernel by this function before calling any other kernel functions
| KER_RES KER_API kerInitAppProc | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Initiate Application Processing.
Initiate Application Processing by get processing options command
This function should be called after kerSelectApp
See EMV Book 3: 10.1 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
Place tran data that already known to Terminal Application. PAN (which is not available at this moment) related data should be passed to kernel later.
| KER_RES KER_API kerIsCashbackAllowed | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Check if card supports Cashback.
See EMV Book 4, 6.3.3 for details.
This function could be called after kerReadAppData
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerOfflineAuth | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Performs offline authentification.
See EMV Book 2; EMV Book 3, 10.3 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerOnline | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_BOOL | bUnableToGoOnline, | ||
| KER_INT16U | usReferralResult | ||
| ) |
Process prev set by kerSetTranData() online authorization data by the kernel and makes second GAC.
Check for advice reqest and reason by kerTranGetFlags
See EMV Book 3, 10.9-10 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | bUnableToGoOnline | - Indicates online availability |
| [in] | usReferralResult | - Indicates voice referral result from attendant: KER_REFFERAL_RES_NA - n/a (referral not supported) KER_REFFERAL_RES_APPROVE - approve requested KER_REFFERAL_RES_DECLINE - decline requested |
| KER_RES KER_API kerProcRestrict | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Performs processing restrictions.
See EMV Book 3, 10.4 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerReadAppData | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Reads application data from ICC.
Reads application data from ICC by set of read record command and validates data obtained
This function should be called after kerInitAppProc
See EMV Book 3: 10.2 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerRiskManagement | ( | KER_CTX_PARAM KER_TRAN * | pTran | ) |
Performs Terminal Risk Management.
See EMV Book 3, 10.6 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| KER_RES KER_API kerSelectApp | ( | KER_CTX_PARAM KER_BYTE | btChipProtocol, |
| const KER_TLV * | pCandidateToSelect, | ||
| KER_TRAN ** | ppTran | ||
| ) |
Makes final app selection.
Select app from previouse build candidate list and allocate transaction structure
This function starts EMV transaction
See EMV Book 1: 12.4 for details.
| [in] | btChipProtocol | - Chip protocol type KER_EMVL1_PROTOCOL_T0 or KER_EMVL1_PROTOCOL_T1 |
| [in] | pCandidateToSelect | - pointer selected candidate container |
| [out] | ppTran | - pointer to obtain allocated transaction structure |
| KER_RES KER_API kerSetCustomCVMResult | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_BYTE | btResult, | ||
| const KER_BYTE * | pbtTvrBitsToSet, | ||
| KER_BYTE | btTvrBitsToSetLen | ||
| ) |
Pass custom CVM result to kernel.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | btResult | - Custom CVM result: KER_CVM_RES_OK - verification success KER_CVM_RES_FAIL - failure (hw error) KER_CVM_RES_UNKNOWN - result defined on issuer side (like online pin) KER_CVM_RES_BYPASS - bypass this CVM by cardholder KER_CVM_RES_UNSUPP - this custom CVM unsupported |
| [in] | pbtTvrBitsToSet | - buffer with bits to | with current TVR (optional, set KER_NULL if you don't need it) |
| [in] | btTvrBitsToSetLen | - length of pbtTvrBitsToSet (5 bytes assumed, 0 if pbtTvrBitsToSet = KER_NULL) |
| KER_RES KER_API kerSetOfflinePinResult | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_BYTE | btResult, | ||
| const KER_BYTE * | pbtPinVerifyData, | ||
| KER_INT16U | usPinVerifyDataLen | ||
| ) |
Pass offline pin entry result to kernel.
See EMV Book 3, 10.5 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | btResult | - Result on online pin entry: KER_CVM_RES_UNKNOWN - offline pin entered (result defined on card side) KER_CVM_RES_FAIL - failure (hw error) KER_CVM_RES_BYPASS - bypass pin entry selected KER_CVM_RES_CANCEL - pin entry cancelled by cardholder |
| [in] | pbtPinVerifyData | PIN verify data: plaintext PIN on enciphered pin |
| [in] | usPinVerifyDataLen | pbtPinVerifyData buffer length |
| KER_RES KER_API kerSetOnlinePinResult | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_BYTE | btResult | ||
| ) |
Pass online pin entry result to kernel.
See EMV Book 3, 10.5 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | btResult | - Result on online pin entry: KER_CVM_RES_UNKNOWN - online pin entered (result defined on issuer side) KER_CVM_RES_FAIL - failure (hw error) KER_CVM_RES_BYPASS - bypass pin entry selected KER_CVM_RES_CANCEL - pin entry cancelled by cardholder |
| KER_RES KER_API kerSetTranData | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| const KER_BYTE * | pbtTranData, | ||
| KER_INT16U | usTranDataLen | ||
| ) |
Pass transaction data to the kernel.
To provide PAN independed transaction data this function could be called after kerSelectApp to let them be used during PDOL processing.
To provide PAN depended transaction data this function could be called just after kerReadAppData
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | pbtTranData | - pointer to transaction data (amount, currency, transaction type, etc... ) as tlv buffer (optional, set KER_NULL if you don't need it) |
| [in] | usTranDataLen | - pbtTranData buffer length |
| KER_RES KER_API kerTAA | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| KER_INT16U | usMode | ||
| ) |
Performs Terminal Action Analysis.
See EMV Book 3, 10.7 for details.
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | usMode | - set KER_TAA_MODE_CHECK_OFFLINE_DECL , KER_TAA_MODE_FINAL_BEFORE_CAA or KER_TAA_MODE_UNABLE_TO_GO_ONLINE |
| KER_RES KER_API kerUpdateTVR | ( | KER_CTX_PARAM KER_TRAN * | pTran, |
| const KER_BYTE * | pbtData, | ||
| KER_INT16U | usDataLen | ||
| ) |
Updates TVR from external (some custom cvm may require this)
To update TVR from external. This function could be called after kerInitAppProc and before kerTAA (final before GAC1)
| [in] | pTran | - pointer to transaction structure obtained by kerSelectApp |
| [in] | pbtData | - pointer to data buffer (5 bytes assumed) to OR with current TVR |
| [in] | usDataLen | - pbtData buffer length |
| KER_BOOL KER_API kerVerInfo | ( | KER_CTX_PARAM KER_CHAR ** | ppchEmvVer, |
| KER_INT16U * | pusEmvVerLen, | ||
| KER_CHAR ** | ppchLibVer, | ||
| KER_INT16U * | pusLibVerLen | ||
| ) |
Obtains emv kernel library version info.
| [out] | ppchEmvVer | pointer to obtain reference to EMV version info (optional, set KER_NULL if you don't need it) |
| [out] | pusEmvVerLen | length of data, including nul-terminated symbol (optional, set KER_NULL if you don't need it) |
| [out] | ppchLibVer | pointer to obtain reference to kernel library version info (optional, set KER_NULL if you don't need it) |
| [out] | pusLibVerLen | length of data, including nul-terminated symbol (optional, set KER_NULL if you don't need it) |